import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hook_rent/pages/home/info/data.dart';
import 'package:hook_rent/pages/home/info/item_widget.dart';
import 'package:hook_rent/widgets/text_widgets.dart';

class Info extends StatelessWidget {
  final bool showTitle;
  final List<InfoItem> dataList;
  const Info({super.key, this.showTitle = false, this.dataList = infoData});

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          if (showTitle)
            Container(
              padding: EdgeInsets.all(10.w),
              child: text16Normal(text: '最新资讯'),
            ),
          Column(
            children: dataList.map((item) => ItemWidget(item)).toList(),
          ),
        ],
      ),
    );
  }
}
